package com.visionblue.business.ship.modbus

/**
 * @author: xlh
 * @date: 2020-06-02 11:11 AM
 * @desc:
 */
interface IOilFlowAccumulationUnitParser {

    fun getAccumulationFlowUnit(unitCode: Int): String
}

class BOilFlowAccumulationUnitParserImpl : IOilFlowAccumulationUnitParser {
    override fun getAccumulationFlowUnit(unitCode: Int): String {
        return when (unitCode) {
            0 -> "L"
            1 -> "m³"
            2 -> "T"
            3 -> "USG"
            else -> ""
        }
    }
}

class COilFlowAccumulationUnitParserImpl : IOilFlowAccumulationUnitParser {

    override fun getAccumulationFlowUnit(unitCode: Int): String {
        return when (unitCode) {
            0, 1, 2 -> "L"
            3, 4, 5 -> "m³"
            6, 7, 8 -> "T"
            9, 10, 11 -> "USG"
            else -> ""
        }
    }
}
